function loadJs (url, success, fail) {
  // eslint-disable-next-line no-undef
  $.getScript(url)
    .done(success && success)
    .fail(fail && fail)
}
var API = (function () {
  function API () {}

  // 加载js的函数
  API.prototype.loadJs = function (url, callback) {
    callback = callback || {}
    loadJs(url, callback.success, callback.fail)
  }

  return API
})()

export default {
  install (Vue) {
      Vue.prototype.$loadJs = new API()
  }
}
